package com.wuzt.jvm.demo;


import java.util.ArrayList;
import java.util.List;

/**
 * 内存溢出整理
 * vm_args:-Xms20m -Xmx20m -XX:+HeapDumpOnOutOfMemoryError
 * 本地jhat /Library/Java/JavaVirtualMachines/jdk1.8.0_131.jdk/Contents/Home/bin
 * @author wuzhentao
 */
public class HeapOom {

    static class OomObject{

    }

    public static void main(String[] args) {
        List<OomObject> list = new ArrayList<>();
        while(true){
            list.add(new OomObject());
        }
    }
}
